layui.config({base: '/merchant/lib/modules/'});
layui.use(['table','form','common'], function(){
    let common = layui.common;
    let init = common.page.init;
    //初始化页面信息
    common.page.info.list={
        tableId:"table_list",
        tableFilter: 'table_list_filter',
        tableToolbar: {
            id:'table_list_tool',
            area : ['500px' , '325px'], //宽高
            methods:{
                add:{url:"editPage" , method :common.page.method.add},
                deletes:{url:"removed", method : common.page.method.removed},
            }
        },
        searchFilter : 'search_filter',
        tableRowToolbar:{
            id :"table_list_row_tool",
            methods:{
                edit:{url:"editPage", method : common.page.method.edit},
                del:{url:"removed", method : common.page.method.removed},
            },
            width:120,
        }
    };
    //初始化 表格
    init.table({
        url: '/merchant/merchant/b_merchant_user/listData', //数据接口
        page: true, //开启分页
        cols: [[ //表头
            {type:'checkbox',width:30,fixed: 'left'},
            {field: 'companyName', title: '公司名称', width:120,align:"center",},
            {field: 'password', title: '密码', width:120,align:"center",},
            {field: 'phone', title: '手机号码(用户名)', width:120,align:"center",},
            {field: 'contactName', title: '联系人', width:120,align:"center",},
            {field: 'contactAddress', title: '联系地址', width:120,align:"center",},
            {field: 'trade', title: '门店类型', width:120,align:"center",},
            {field: 'remark', title: '备注', width:120,align:"center",},
            {field: 'provinceCode', title: '省code', width:120,align:"center",},
            {field: 'cityCode', title: '市code', width:120,align:"center",},
            {field: 'areaCode', title: '区县code', width:120,align:"center",},
            {field: 'industryId', title: '行业分类id', width:120,align:"center",},
            {field: 'faceUrl', title: '头像url', width:120,align:"center",},
            {field: 'faceDomain', title: '头像域名', width:120,align:"center",},
            {field: 'nickname', title: '昵称', width:120,align:"center",},
            {field: 'userScore', title: '用户积分，（我们生成，不做double）', width:120,align:"center",},
            {field: 'creditRating', title: '信用等级  0无等级', width:120,align:"center",},
            {field: 'registerId', title: '注册id', width:120,align:"center",},
            {field: 'userGrade', title: '用户品级，越小品级越高', width:120,align:"center",},
            {field: 'errorNum', title: '密码输入错误次数', width:120,align:"center",},
            {field: 'errorDate', title: '最后一次错误时间', width:120,align:"center",},
            {field: 'versionCode', title: '云后台版本code', width:120,align:"center",},
            {field: 'expireDate', title: '到期日期', width:120,align:"center",},
            {field: 'state', title: '状态', width:120,align:"center",},
            {field: 'isSingleUnit', title: '是否支持单店单价', width:120,align:"center",},
            {field: 'isUpSalePrice', title: '员工是否可以修改售价', width:120,align:"center",},
            {field: 'alipaySplitRatio', title: '分账比例', width:120,align:"center",},
            {field: 'userType', title: '使用类型', width:120,align:"center",},
            {field: 'isSignin', title: 'POS点数', width:120,align:"center",},
            {field: 'userProperty', title: '商户类型', width:120,align:"center",},
        ]]
    });
    //初始化 搜索
    init.search();
    //初始化 工具栏
    init.toolbar();
    //初始化 行工具栏
    init.rowToolbar();
    //回车 搜索
    init.enterSearch();
});